after withColumn by UDF run count() gives TypeError: 'NoneType' object is not subscriptable

join shbcf.ru